﻿namespace Utils
{
    public static partial class ExtensionHelper
    {
        /// <summary>
        /// 字符串的 Md5
        /// </summary>
        /// <param name="str"></param>
        /// <returns>string</returns>
        public static string ToMd5(this string str)
        {
            return Md5Helper.Md5(str);
        }
        ///// <summary>
        ///// 字符串的Hash
        ///// </summary>
        ///// <param name="str">需要计算hash的字符串</param>
        ///// <returns>string</returns>
        //public static string ToHash(this string str)
        //{
        //    return HashHelper.Hash(str);
        //}
        ///// <summary>
        ///// 字符串Aes 加密
        ///// </summary>
        ///// <param name="data">需要加密的字符串</param>
        ///// <returns>string</returns>
        //public static string ToAesEncry(this string data)
        //{
        //    return AesHelper.Encrypt(data);
        //}
        ///// <summary>
        ///// 字符串Aes 解密
        ///// </summary>
        ///// <param name="data"></param>
        ///// <returns>string</returns>
        //public static string ToAesDecry(this string data)
        //{
        //    return AesHelper.Decrypt(data);
        //}
        ///// <summary>
        ///// 字符串Aes 加密
        ///// </summary>
        ///// <param name="data">需要加密的字符串</param>
        ///// <param name="key">密钥</param>
        ///// <returns>string</returns>
        //public static string ToAesEncry(this string data, string key)
        //{
        //    return AesHelper.Encrypt(data, key);
        //}
        ///// <summary>
        ///// 字符串Aes 解密
        ///// </summary>
        ///// <param name="data">需要解密的字符串</param>
        ///// <param name="key">密钥</param>
        ///// <returns>string</returns>
        //public static string ToAesDecry(this string data, string key)
        //{
        //    return AesHelper.Decrypt(data, key);
        //}
        ///// <summary>
        ///// 字符串Aes 加密
        ///// </summary>
        ///// <param name="data">需要加密的字符串</param>
        ///// <param name="key">密钥</param>
        ///// <param name="iv">向量</param>
        ///// <returns>string</returns>
        //public static string ToAesEncry(this string data, string key, string iv)
        //{
        //    return AesHelper.Encrypt(data, key, iv);
        //}
        ///// <summary>
        ///// 字符串Aes 解密
        ///// </summary>
        ///// <param name="data">需要解密的字符串</param>
        ///// <param name="key">密钥</param>
        ///// <param name="iv">向量</param>
        ///// <returns>string</returns>
        //public static string ToAesDecry(this string data, string key, string iv)
        //{
        //    return AesHelper.Decrypt(data, key, iv);
        //}
        ///// <summary>
        ///// 字符串Aes 加密
        ///// </summary>
        ///// <param name="data">需要加密的字符串</param>
        ///// <param name="key">密钥</param>
        ///// <param name="iv">向量</param>
        ///// <returns>Byte[]</returns>
        //public static byte[] ToAesEncry(this byte[] data, byte[] key, byte[] iv)
        //{
        //    return AesHelper.Encrypt(data, key, iv);
        //}
        ///// <summary>
        ///// 字符串Aes 解密
        ///// </summary>
        ///// <param name="data">需要解密的字符串</param>
        ///// <param name="key">密钥</param>
        ///// <param name="iv">向量</param>
        ///// <returns>Byte[]</returns>
        //public static byte[] ToAesDecry(this byte[] data, byte[] key, byte[] iv)
        //{
        //    return AesHelper.Decrypt(data, key, iv);
        //}


        #region Aes 无向量加密解密
        ///// <summary>
        ///// Aes 无向量加密
        ///// </summary>
        ///// <param name="data">加密byte[]</param>
        ///// <param name="key">密钥</param>
        ///// <returns></returns>
        //public static byte[] EncryptNoIv(this byte[] data, byte[] key)
        //{
        //    return AesHelper.EncryptNoIv(data, key);
        //}
        ///// <summary>
        ///// Ase 无向量解密
        ///// </summary>
        ///// <param name="data">解密 byte[]</param>
        ///// <param name="key">密钥</param>
        ///// <returns></returns>
        //public static byte[] DecryptNoIv(this byte[] data, byte[] key)
        //{
        //    return AesHelper.DecryptNoIv(data, key);
        //}
        ///// <summary>
        ///// Aes 无向量加密
        ///// </summary>
        ///// <param name="data">需要加密的字符串</param>
        ///// <param name="key">密钥</param>
        ///// <returns>string</returns>
        //public static string EncryptNoIv(this string data, string key)
        //{
        //   return AesHelper.EncryptNoIv(data, key);
        //}
        ///// <summary>
        ///// Ase 无向量解密
        ///// </summary>
        ///// <param name="data">需要解密字符串</param>
        ///// <param name="key">密钥</param>
        ///// <returns>string</returns>
        //public static string DecryptNoIv(this string data, string key)
        //{
        //    return DecryptNoIv(data, key);
        //}
        ///// <summary>
        ///// Aes 无向量加密
        ///// </summary>
        ///// <param name="data">需要加密的字符串</param>
        ///// <returns>string</returns>
        //public static string EncryptNoIv(this string data)
        //{
        //    return EncryptNoIv(data);
        //}
        ///// <summary>
        ///// Ase 无向量解密
        ///// </summary>
        ///// <param name="data">需要解密字符串</param>
        ///// <returns>string</returns>
        //public static string DecryptNoIv(this string data)
        //{
        //    return DecryptNoIv(data);
        //}

        #endregion
    }
}
